﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace VkApi.DataTypes
{
    /// <summary>
    /// Calss that represents the information about parameters.
    /// </summary>
    public class Parameter
    {
        private string _name = null;
        private string _value = null;


        /// <summary>
        /// Gets or sets the name of parameter.
        /// </summary>
        /// <value>The name.</value>
        public string Name
        {
            get { return this._name; }
            set
            {
                if (String.IsNullOrEmpty(value) || value.Trim().Length == 0)
                    throw new Exception("Paramater name cannot be empty!");

                this._name = value.Trim();
            }
        }


        /// <summary>
        /// Gets or sets the value of parameter.
        /// </summary>
        /// <value>The value.</value>
        public string Value
        {
            get { return this._value; }
            set
            {
                if (value == null)
                    this._value = String.Empty;
                else
                    this._value = value;
            }
        }


        /// <summary>
        /// Initializes a new instance of the <see cref="Parameter"/> class.
        /// </summary>
        /// <param name="name">The name of parameter.</param>
        /// <param name="value">The value of parameter.</param>
        public Parameter(string name, string value)
        {
            this.Name = name;
            this.Value = value;
        }
    }
}
